"  MkSession - Easy session shortcuts
"  ----------------------------------
"  Version: 0.01
"  Author: Albie Janse van Rensburg
"  Date: 2009-06-23
"  Description: A plugin that creates or loads a Session.vim file in the 
"  current directory (as seen using :pwd) with prompts.  Useful as a shortcut.

" Check if loaded {{{1
if exists('g:loaded_mksession') || &compatible
	finish
endif
let g:loaded_compile_project = 1

" Session variables {{{1
" set sessionoptions-=options
set sessionoptions+=resize
set sessionoptions+=winpos
set sessionoptions+=buffers

" New Mksession command - saves the current colorscheme as well as the session " {{{1
:command -bang Mksession
         \ mksession<bang> <args> <bar>
         \ call writefile(['set bg='.&bg, 'color '.colors_name], fnamemodify(v:this_session, ':p:r') . 'x.vim')

" Keyboard shortcuts {{{1
" make a session in the current directory
nnoremap <silent> <S-F2> :execute(input("Write Session.vim? (y/n) ") == "y" ? "Mksession!" : "")<CR>
" loads a session in the current directory
nnoremap <silent> <F2> :execute(input("Load Session.vim? (y/n) ") == "y" ? "so Session.vim" : "")<CR>

" Modelines {{{1
" vim: ts=4 nowrap fdm=marker
